package com.docjohnson.pamphlet.activities;

import android.os.Bundle;

import com.docjohnson.pamphlet.R;
import com.docjohnson.pamphlet.utils.PamphletPreferences;
import com.docjohnson.pamphlet.views.ScreenSaverView;

public class ScreenSaverActivity extends DefaultActivity {
	
	private PamphletPreferences prefs;
	private ScreenSaverView screenSaverView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		prefs = new PamphletPreferences(this);
		setContentView(R.layout.screensaver);
		screenSaverView = (ScreenSaverView) findViewById(R.id.screen_saver);
		screenSaverView.setImageList(prefs.getScreenSaverImageList());
	}
	
	@Override
	public void onBackPressed() {
		super.onBackPressed();
		finishScreenSaver();
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		
		screenSaverView.recycleBitmaps();
	}
}
